<?php
class Model {
	public function __construct()
	{
		
	}
	
	public function query($q)
	{
		mysql_query($q) or die(mysql_error(). " Die when trying to query into db");
	}
	
	public function insert($q)
	{
		mysql_query($q) or die(mysql_error(). " Die when trying to insert records into db");
		return mysql_insert_id();
	}
	
	public function fetchMultiple($q)
	{
		$result = mysql_query($q) or die(mysql_error(). " Die when trying to fetch db");
		$return = array();
		while ($row = mysql_fetch_array($result))
		{
			$return[] = $row;
		}
		
		return $return;
	}
	
	public function __destruct()
	{
		
	}
}